<template>
<h2>显示会员等级</h2>
<table class="table table-broder">
    <thead>
        <tr>
        <th>会员等级id</th>
        <th>会员级别名称</th>
        <th>累计最低消费额(元)</th>
        <th>操作</th>
        </tr>

    </thead>
        <tbody v-for="item in aa">

            <tr>
        <th>{{ item.did }}</th>
        <th>{{ item.dname }}</th>
        <th>{{ item.xiaoFeie }}</th>
        <th><a hre="#" @click="Xg(item.did)">修改</a></th>
        </tr>
        </tbody>

</table>




</template>

<script setup lang="ts">

    import axios from 'axios';
import{onMounted, ref} from 'vue';

import {useRouter,createRouter} from'vue-router'
     


        onMounted(()=>{
            ShowDengji();

        })
        const aa =ref([{

did: 0,
dname: "",
xiaoFeie: 0    


   }])

        const  ShowDengji=()=>{   

                axios.get('https://localhost:7296/api/Dengji/ShowDengji').then(res=>{


                        aa.value=res.data
                })
                .catch(error=>{

                    console.log(error);
                })

        }



        const router=useRouter()

            const Xg=(Did:number)=>{
               
                    router.push({

                            
                    name:'XgDengji',
                        params:{
                            Did:Did
                         
                        }


                    })

            }

</script>